<?php
require( 'Root.php' );
class Child extends Root {
	//protected $field = array();
	public function __get( $key ) {
		switch( $key ) {
			case 'user_id':
				$key = 'id';
				break;
			case 'id':
			case 'name':
			case 'parent':
				break;
			default:
				echo "no such attr";
		}
		//if( !isset( $this->field[ $key ] ) ) {
            //return null;
       // }
		return parent::__get( $key );// $this->field[ $key ];
	}
	public function __set( $key, $value ) {
		switch( $key ) {
			case 'user_id':
				$key = 'id';
				break;
			case 'id':
			case 'name':
			case 'parent':
				break;
			default:
				echo "no such attr";
		}
		$this->field[ $key ] = $value;
	}
	public function __construct() {
		parent::__construct();
		$this->field[ "parent" ] = null;
		$this->dbname = "DB_TEST";
		//parent::setStaticType( "[Child Type]" );
		$this->attr = "<br/>this is from child";
	}
	//protected $dbname;
	protected static $typeName = "[Child Type]";
	
	//protected static $qstr = ";
}
?>